﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToPLMX.Views.CUiETPXContentView
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.ExportToPLMX.ViewModels;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using Tecnomatix.Engineering.Ui;
using Tecnomatix.Engineering.Ui.WPF;


namespace DnProcessSimulateCommands.ExportToPLMX.Views;

public class CUiETPXContentView : UserControl, IComponentConnector
{
  internal ComboBox LODPicker;
  internal CheckBox InclueSimulationCheckbox;
  internal TxObjEditBoxControl OperationCtrl;
  private bool _contentLoaded;

  public CUiETPXContentView()
  {
    this.InitializeComponent();
    this.InitOperationCtrl();
  }

  private void InitOperationCtrl()
  {
    // ISSUE: unable to decompile the method.
  }

  private void OperationCtrl_TypeValid(object sender, EventArgs e)
  {
    (this.DataContext as CUiETPXContentViewModel).IsOperationValid = true;
  }

  private void OperationCtrl_TypeInvalid(object sender, EventArgs e)
  {
    (this.DataContext as CUiETPXContentViewModel).IsOperationValid = string.IsNullOrEmpty(this.OperationCtrl.Text);
  }

  private void OperationCtrl_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
  {
    if (this.OperationCtrl.IsEnabled)
      this.OperationCtrl.Focus();
    else
      this.OperationCtrl.LoseFocus();
  }

  private void OperationCtrl_Picked(object sender, TxObjEditBoxCtrl_PickedEventArgs args)
  {
    this.OperationCtrl.Focus();
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  public void InitializeComponent()
  {
    if (this._contentLoaded)
      return;
    this._contentLoaded = true;
    Application.LoadComponent((object) this, new Uri("/DnProcessSimulateCommands;component/exporttoplmx/views/cuietpxcontentview.xaml", UriKind.Relative));
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  [EditorBrowsable(EditorBrowsableState.Never)]
  void IComponentConnector.Connect(int connectionId, object target)
  {
    switch (connectionId)
    {
      case 1:
        this.LODPicker = (ComboBox) target;
        break;
      case 2:
        this.InclueSimulationCheckbox = (CheckBox) target;
        break;
      case 3:
        this.OperationCtrl = (TxObjEditBoxControl) target;
        this.OperationCtrl.TypeValid += new EventHandler(this.OperationCtrl_TypeValid);
        this.OperationCtrl.TypeInvalid += new EventHandler(this.OperationCtrl_TypeInvalid);
        ((UIElement) this.OperationCtrl).IsEnabledChanged += new DependencyPropertyChangedEventHandler(this.OperationCtrl_IsEnabledChanged);
        this.OperationCtrl.Picked += new TxObjEditBoxCtrl_PickedEventHandler(this.OperationCtrl_Picked);
        break;
      default:
        this._contentLoaded = true;
        break;
    }
  }
}
